<template>
  <div class="componentA">
    <h1>我是A组建</h1>
    <!-- <p @click="changeTitle">{{ title }}</p> -->
    <input type="text" :value="title" @change="changeTitle">
  </div>
</template>

<script setup lang="ts">
//能获取组件上的信息
import { getCurrentInstance, computed, ref } from 'vue';

type props = {
  title: string
}



const prop = defineProps<props>()
const emit = defineEmits(['update:title'])
const changeTitle = (e: any) => {


  emit('update:title', e?.target?.value)
} 
</script>

<style lang="less" scoped>
.componentA {
  height: 200px;
  border: 1px solid #ccc;
}
</style>